<?php

namespace App\Http\Queries;

use App\Models\Dealer;
use Spatie\QueryBuilder\QueryBuilder;
use Spatie\QueryBuilder\AllowedFilter;

class DealerQuery extends QueryBuilder
{
    public function __construct()
    {
        parent::__construct(Dealer::query());
        $this->allowedFilters([
            'name',
            AllowedFilter::exact('area_code'),
            AllowedFilter::exact('code'),
        ]);
        $this->defaultSort('-id');
    }
}
